<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser;$(NetCoreAppCurrent)</TargetFrameworks>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
  </PropertyGroup>

  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
  <PropertyGroup>
    <TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == 'browser' or '$(TargetPlatformIdentifier)' == ''">SR.SystemNetNameResolution_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
    <ApiExclusionListPath Condition="'$(TargetPlatformIdentifier)' == 'browser'">ExcludeApiList.PNSE.Browser.txt</ApiExclusionListPath>
  </PropertyGroup>

  <ItemGroup Condition="'$(GeneratePlatformNotSupportedAssemblyMessage)' == ''">
    <Compile Include="System\Net\Dns.cs" />
    <Compile Include="System\Net\IPHostEntry.cs" />
    <Compile Include="System\Net\NetEventSource.NameResolution.cs" />
    <Compile Include="System\Net\NameResolutionMetrics.cs" />
    <Compile Include="System\Net\NameResolutionTelemetry.cs" />
    <!-- Logging -->
    <Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs"
             Link="Common\System\Net\Logging\NetEventSource.Common.cs" />
    <Compile Include="$(CommonPath)System\Net\InternalException.cs"
             Link="Common\System\Net\InternalException.cs" />
    <!-- System.Net common -->
    <Compile Include="$(CommonPath)System\Net\IPAddressParserStatics.cs"
             Link="Common\System\Net\IPAddressParserStatics.cs" />
    <Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.cs"
             Link="Common\System\Net\SocketProtocolSupportPal.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
    <Compile Include="System\Net\NameResolutionPal.Windows.cs" />
    <!-- Debug only -->
    <Compile Include="$(CommonPath)System\Net\DebugSafeHandle.cs"
             Link="Common\System\Net\DebugSafeHandle.cs" />
    <!-- System.Net common -->
    <Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.Windows.cs"
             Link="Common\System\Net\SocketProtocolSupportPal.Windows" />
    <Compile Include="$(CommonPath)System\Net\SocketAddressPal.Windows.cs"
             Link="Common\System\Net\SocketAddressPal.Windows" />
    <!-- Interop -->
    <Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
             Link="Common\Interop\Windows\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.LoadLibraryEx_IntPtr.cs"
             Link="Common\Interop\Windows\Kernel32\Interop.LoadLibraryEx_IntPtr.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\AddressInfoHints.cs"
             Link="Common\Interop\Windows\WinSock\AddressInfoHints.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.closesocket.cs"
             Link="Common\Interop\Windows\WinSock\Interop.closesocket.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.gethostname.cs"
             Link="Common\Interop\Windows\WinSock\Interop.gethostname.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.GetNameInfoW.cs"
             Link="Common\Interop\Windows\WinSock\Interop.GetNameInfoW.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.GetAddrInfoW.cs"
             Link="Common\Interop\Windows\WinSock\Interop.GetAddrInfoW.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.WSAStartup.cs"
             Link="Common\Interop\Windows\WinSock\Interop.WSAStartup.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.WSASocketW.cs"
             Link="Common\Interop\Windows\WinSock\Interop.WSASocketW.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.SocketConstructorFlags.cs"
             Link="Common\Interop\Windows\WinSock\Interop.SocketConstructorFlags.cs" />
    <Compile Include="$(CommonPath)System\Net\Sockets\ProtocolFamily.cs"
             Link="Common\System\Net\Sockets\ProtocolFamily.cs" />
    <Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.GetAddrInfoExW.cs"
             Link="Common\Interop\Windows\WinSock\Interop.GetAddrInfoExW.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'unix'">
    <Compile Include="System\Net\NameResolutionPal.Unix.cs" />
    <Compile Include="$(CommonPath)System\Net\InteropIPAddressExtensions.Unix.cs"
             Link="Common\System\Net\InteropIPAddressExtensions.Unix.cs" />
    <Compile Include="$(CommonPath)System\Net\SocketAddressPal.Unix.cs"
             Link="Common\System\Net\Internals\SocketAddressPal.Unix.cs" />
    <Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.Unix.cs"
             Link="Common\System\Net\SocketProtocolSupportPal.Unix" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
             Link="Common\Interop\CoreLib\Unix\Interop.Errors.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
             Link="Common\Interop\Unix\Interop.Libraries.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Close.cs"
             Link="Common\Interop\Unix\System.Native\Interop.Close.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetHostName.cs"
             Link="Common\Interop\Unix\System.Native\Interop.GetHostName.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetNameInfo.cs"
             Link="Common\Interop\Unix\System.Native\Interop.GetNameInfo.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.HostEntry.cs"
             Link="Common\Interop\Unix\System.Native\Interop.HostEntries.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.IPAddress.cs"
             Link="Common\Interop\Unix\System.Native\Interop.IPAddress.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Socket.cs"
             Link="Common\Interop\Unix\System.Native\Interop.Socket.cs" />
    <Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.SocketAddress.cs"
             Link="Common\Interop\Unix\System.Native\Interop.SocketAddress.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'browser'">
    <Compile Include="System\Net\Dns.Browser.cs" />
  </ItemGroup>

  <ItemGroup>
    <Reference Include="Microsoft.Win32.Primitives" />
    <Reference Include="System.Collections" />
    <Reference Include="System.Diagnostics.DiagnosticSource" />
    <Reference Include="System.Diagnostics.Tracing" />
    <Reference Include="System.Memory" />
    <Reference Include="System.Net.Primitives" />
    <Reference Include="System.Runtime" />
    <Reference Include="System.Runtime.InteropServices" />
    <Reference Include="System.Security.Claims" />
    <Reference Include="System.Security.Principal.Windows" />
    <Reference Include="System.Threading" />
    <Reference Include="System.Threading.Overlapped" />
    <Reference Include="System.Threading.ThreadPool" />
  </ItemGroup>

</Project>
